package leetcode;

import java.util.*;
import java.math.*;
public class Main{
    public static void main(String args[]){
        Scanner sc = new Scanner(System.in);
        while(sc.hasNext()){
            String[] s = sc.nextLine().split(" ");
            int[] nums = new int[s.length];
            for(int i = 0;i<s.length;i++){
                nums[i] = Integer.parseInt(s[i]);
            }
            String[] s2 = sc.nextLine().split(" ");
            int[] nums2 = new int[s2.length];
            for(int i = 0;i<s2.length;i++){
                nums2[i] = Integer.parseInt(s2[i]);
            }
            int max = Math.max(nums[2],nums[3]);
            int min = Math.min(nums[2],nums[3]);
            if(help(nums[0],nums[1],min,max,nums2)){
                System.out.println("YES");
            }else{
                System.out.println("NO");
            }
        }
    }
    public static boolean help(int m,int n,int min,int max,int[] nums){
        Arrays.sort(nums);
        int res = m-n;
        if(min>nums[0]||max<nums[nums.length-1]){
            return false;
        }else if(min<nums[0]&&max>nums[nums.length-1]){
            if(res<2){
                return false;
            }
        }else if((min<nums[0])||(max>nums[nums.length-1])){
            if(res<1){
                return false;
            }
        }
        return true;
    }


}